<template>
</template>

<script>
	
	// import BaseExtends from '@/BaseExtends.vue'
	import BaseMixins from '@/BaseMixins.js'
	
	export default {
		// extends: BaseExtends,
		mixins: [BaseMixins],
		props: {
			// ...
		},
		data() {
			return {
				// ...
			}
		},
		methods: {
			// 点击事件，控制是否不想要冒泡
			onClick(event, {
				name = 'click',
				disabled = 'disabled',
				cancelBubble = 'cancelBubble'
			} = {}) {
				if (this[disabled]) {
					
				} else {
					if (this[cancelBubble]) {
						/**
						 * cancelBubble在小程序中不生效
						 * 须使用click.stop => onStop事件
						 * 但是click.stop会完全阻隔父组件接收事件，无法解决这个矛盾
						 * 
						 * 实测这种写法在H5中也并不能阻止向父元素冒泡
						 */
						if (event.stopPropagation) {
							event.stopPropagation()
							// console.log('阻止了事件冒泡') // 目前已知在h5上并没有阻止。h5的有效措施还是在于代码中的 :onClick="`event.cancelBubble = ${cancelBubble}`"
						}
						this.$emit(name)
					} else {
						this.$emit(name)
					}
				}
			}
		},
		computed: {
			// ...
		},
		created() {
			// ...
		},
		mounted() {
			// ...
		}
	}
</script>

<style>
</style>